package shiyan;

import java.util.*;


public class two {

	public static void main(String[] args) {
		Scanner in=new Scanner(System.in);
		TreeSet<String> str=new TreeSet<String>();
		while(in.hasNext()){
			String str1=in.next();
			if(str1.equals("!!!!!")) 
				break;
			str.add(str1);
		}
		System.out.println(str.size());	
			Object[] out = str.toArray();
			if(str.size()<=10)
				for (int i = 0; i < out.length; i++) {
					System.out.println(out[i]);
				}
			else for (int j = 0; j < 10; j++) {
				System.out.println(out[j]);
			
		}
	}
	
}